% TEST_ID: LANG-EXPAND-0089
% CATEGORY: stdlib/arithmetic_ops/triangle
% 测试 三角函数

function test_atanh_cosd_cospi_cotd()

assert(cospi(1.5) == 0)
assert(cospi(-0.5)== 0)
assert(cospi(2) == 1)
assert(cospi(3) == -1)
assert(round(cospi(0.2 + 0.2i), 15) == 0.974033881027733 - 0.394100606067748i)

assert(cotd(360) == inf)
assert(cotd(180) == -inf)
assert(cotd(90) == 0)
assert(cotd(45) - 1 < 1e-12)
% assert(round(cotd(2+2i), 15) == 14.312311240701041 - 14.335582296516842i)
assert(abs(real(cotd(2+2i)) - 14.312311240701041) < 1e-12 && abs(imag(cotd(2+2i)) + 14.335582296516842) < 1e-12)

assert(cosd(360) - 1 < 1e-12)
assert(cosd(180) + 1 < 1e-12)
assert(cosd(90) == 0)
assert(cosd(45) - 0.707106781186548 < 1e-12)
assert(round(cosd(45+45i), 15) == 0.936640069431430 - 0.614243127486596i)

assert(round(atanh(3), 15) == 0.346573590279973 + 1.570796326794897i)
assert(round(atanh(0.5), 15) == 0.549306144334055)
assert(round(atanh(2 + 2i), 15) ==   0.238877861256859 + 1.311223269671635i)
